﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace C12_Ex03_Shaked_032675316_Itay_032511057
{
    public static class DateTimeExtender
    {
        public static string GetDifferenceDate(this DateTime date1, DateTime date2)
        {
            if (DateTime.Compare(date1, date2) >= 0)
            {
                TimeSpan timeSpan = date1.Subtract(date2);
                return string.Format("{0} days, {1} hours, {2} minutes, {3} seconds", timeSpan.Days, timeSpan.Hours, timeSpan.Minutes, timeSpan.Seconds);
            }
            else
            {
                return "Not valid";
            }
        }
    }
}
